package br.mil.eb.pqrmnt7.scc.entity;


import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Access;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.AccessType;
import com.powerlogic.jcompany.commons.config.stereotypes.SPlcEntity;
import javax.persistence.Entity;
/**
 * Classe Concreta gerada a partir do assistente
 */
@SPlcEntity
@Entity
@Table(name="VIATURA")
@SequenceGenerator(name="SE_VIATURA", sequenceName="SE_VIATURA")
@Access(AccessType.FIELD)

@NamedQueries({
	@NamedQuery(name="ViaturaEntity.queryMan", query="from ViaturaEntity"),
	@NamedQuery(name="ViaturaEntity.querySel", query=" select obj.id as id, " +
															 "obj.modelo as modelo, " +
															 "obj.numeroEB as numeroEB, " +
															 "obj1.id as tipoCombustivel_id , " +
															 "obj1.nome as tipoCombustivel_nome, " +
															 "obj.descricao as descricao " +
													 	"from ViaturaEntity obj " +
													 		"left outer join obj.tipoCombustivel as obj1 " +
													 		"order by obj.modelo asc"),
	@NamedQuery(name="ViaturaEntity.querySelLookup", query=" select id as id, " +
																   "modelo as modelo, " +
																   "numeroEB as numeroEB " +
																"from ViaturaEntity " +
																"where id = ? " +
																"order by modelo asc")
})
public class ViaturaEntity extends Viatura {

	private static final long serialVersionUID = 1L;
 	
    /*
     * Construtor padrao
     */
    public ViaturaEntity() {
    }
    
	@Override
	public String toString() {
		
		return getModelo() + " - " + getNumeroEB();
		
	}

}
